tmem: Prevent NULL dereference on error case
authorMatthew Daley <mattjd@gmail.com>
Mon, 12 Nov 2012 08:34:57 +0000 (09:34 +0100)
committerMatthew Daley <mattjd@gmail.com>
Mon, 12 Nov 2012 08:34:57 +0000 (09:34 +0100)
commitb85a0ab12280192fb864339543a942dbed90577c
treed0d0177146e3137c5e7dc824c732914d8afc87d9
parente99d45da8a95453a3f4a5433ba9e8cc524bf60d2
tmem: Prevent NULL dereference on error case

If the client / pool IDs given to tmemc_save_get_next_page are invalid,
the calculation of pagesize will dereference NULL.

Fix this by moving the calculation below the appropriate NULL check.

Signed-off-by: Matthew Daley <mattjd@gmail.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen/common/tmem.c